package com.yujin;
import org.junit.Test;

public class App {
	
	
	@Test
	public void test(){
		Student stu = new Student(1,"张三",12,new ClassRom(1,"12级Java2班",4));
		System.out.println(XmlUtils.javaBean2Xml(Student.class,stu));
		
		String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><student><age>12</age><classRom><grade>4</grade><id>1</id><name>12级Java2班</name></classRom><id>1</id><name>张三</name></student>";
		Student stu1 = (Student) XmlUtils.xml2JavaBean(Student.class,xml);
		System.out.println(stu1.getName());
	}
	
}
